package com.zhuss.want.processor;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zhuss.bean.vo.want.want.DetailWantAppendVo;
import com.zhuss.exception.ExceptionCode;
import com.zhuss.exception.WpsException;
import com.zhuss.want.db.dao.ext.WantAppendDao;


/**
 * 查询求职Append processor
 * @Author: zhushanshuo
 * @Date: 2019/9/24 19:54
 */
@Component("wantAppendRead")
public class WantAppendRead {
	
	@Autowired
	private WantAppendDao wantAppendDao;
	
	
	public List<DetailWantAppendVo> listByType(Integer type, Long wantId, Long creatorId) {
		List<DetailWantAppendVo> list = wantAppendDao.listByType(type, wantId, creatorId);
		return list;
	}
	
	public DetailWantAppendVo getByType(Integer type, Long wantId, Long creatorId) {
		DetailWantAppendVo result = wantAppendDao.getByType(type, wantId, creatorId);
		return result;
	}
	
	/**
	 * 求职Append详情
	 * @param wantAppendId
	 * @return
	 * @throws WpsException
	 */
	public Object detail(Long wantAppendId) throws WpsException {
		Object result = wantAppendDao.detail(wantAppendId);
		if (result == null) {
			throw new WpsException(ExceptionCode.数据不存在);
		}
		return result;
	}
	
	

}
